package br.ufrn.dimap.ase.squid.metrics.visitors;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.part.ViewPart;

import br.ufrn.dimap.ase.squid.metrics.views.tree.MetricsContentProvider;

public class MetricView extends ViewPart {
	private Label label;
	private TreeViewer tree;
	
	public MetricView(){
		super();
	}

	@Override
	public void createPartControl(Composite parent) {
		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
		
		tree = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
		tree.setContentProvider(new MetricsContentProvider(projects));
//		tree.setLabelProvider(new TodoLabelProvider());
		
//		label = new Label(parent, 0);
//		label.setText("Hello World");
	}

	@Override
	public void setFocus() {
//		label.setFocus();
		tree.getControl().setFocus();
	}

}
